﻿using System;
using System.Collections.Generic;
using System.Windows;
using CommonControlLibrary;
using QueryResource.Common;

namespace SimpleControlLibrary
{
    public class DesignWindow : IDesignWindow
    {
        private NewMainWindow _window;
        #region IDesignWindow 成员
        public ISplash GetSplash { get; set; }

        public System.Windows.Window GetMainWindow()
        {
            MessageBoxHelper.Show = msg => MessageBox.Show(msg, string.Empty);
            MessageBoxHelper.ShowCaption = (msg, caption) => MessageBox.Show(msg, caption);
            MessageBoxHelper.ShowMessage = (msg, caption, btns, imgs)=> MessageBox.Show(msg, caption, btns, imgs);

            _window = new NewMainWindow(GetSplash);
            return _window;
        }

        public void CreateResourceDictionary(out IEnumerable<ResourceDictionary> resourceList)
        {
            Uri uri = new Uri("SimpleControlLibrary;component/Style/DataGridStyle.xaml", UriKind.Relative);
            ResourceDictionary dic = new ResourceDictionary();
            dic.Source = uri;
            resourceList = new ResourceDictionary[]
                               {
                                   dic
                               };
        }

        public void SaveDocumentContent()
        {
            //if (_window != null)
                //_window.SaveDocumentContent();
        }

        #endregion
    }
}
